const express = require("express");

const companyController = require("../controller/companyController");
const requireAuth = require("../middleware/requireAuth");

const router = express.Router({ mergeParams: true });

router
  .route("/")
  .get(companyController.getAllcompany)
  .delete(companyController.deleteCompany)
  .patch(companyController.updateCompany);

//获取用户公司信息
router.get(
  "/usercompanyinfo",
  requireAuth,
  companyController.getCompanyInfoById
);
//更新用户公司信息
router.post(
  "/usercompanyinfo",
  requireAuth,
  companyController.updateCompanyInfoById
);
router.post("/", requireAuth, companyController.createCompany);

module.exports = router;
